using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BaHuan.Common;
using BaHuan.Entities;
using BaHuan.DataLayer;
/*
 * There are many processes that handle the flows of data
 * we call them business logic of a program.
 * For each of business logic process we create a class 
 * that handle for that process
 * 
 * */
namespace BaHuan.BusinessLayer
{
	
	public class PhanQuyenMgt
	{
	
		public ResultObj SaveNewPhanQuyen(PhanQuyen phanquyen)
        		{
			ResultObj result = new ResultObj();
			phanquyen.Id = -1;
			PhanQuyenDAO phanquyenDAO = new PhanQuyenDAO();
			result = phanquyenDAO.SavePhanQuyen(phanquyen);
			
			return result;
		}
		
		public ResultObj UpdatePhanQuyen(PhanQuyen phanquyen)
        		{
			ResultObj result = new ResultObj();
			PhanQuyenDAO phanquyenDAO = new PhanQuyenDAO();
			result = phanquyenDAO.SavePhanQuyen(phanquyen);
			
			return result;
		}
		
		public ResultObj DeletePhanQuyen(PhanQuyen phanquyen)
        		{
			ResultObj result = new ResultObj();
			PhanQuyenDAO phanquyenDAO = new PhanQuyenDAO();
			result = phanquyenDAO.DeletePhanQuyen(phanquyen);
			
			return result;
		}
		
		public ResultObj GetAllPhanQuyen( )
        		{
			ResultObj result = new ResultObj();
			PhanQuyenDAO phanquyenDAO = new PhanQuyenDAO();
			result = phanquyenDAO.GetAllPhanQuyen();
			
			return result;
		}
		
		public ResultObj GetPhanQuyenById(PhanQuyen phanquyen)
        		{
			ResultObj result = new ResultObj();
			PhanQuyenDAO phanquyenDAO = new PhanQuyenDAO();
			result = phanquyenDAO.GetAllPhanQuyenByID(phanquyen);
			
			return result;
		}

        public ResultObj GetAllPhanQuyenByIDChucVu(PhanQuyen phanquyen)
        {
            ResultObj result = new ResultObj();
            PhanQuyenDAO phanquyenDAO = new PhanQuyenDAO();
            result = phanquyenDAO.GetAllPhanQuyenByIDChucVu(phanquyen);

            return result;
        }
	}
}
